<div class="main-content">
    <!-- #section:basics/content.breadcrumbs -->
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb"><li>
                <i class="ace-icon fa fa-th-large th-large-icon"></i> 酒店管理 <i class="ace-icon fa fa-angle-double-right"></i> 酒店列表 
            </li></ul><!-- /.breadcrumb -->
    </div>

    <!-- /section:basics/content.breadcrumbs -->
    <div class="page-content">
        <!-- #section:settings.box -->
        <div class="ace-settings-container" id="ace-settings-container" style="margin-top:-48px;">
            <div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
                <i class="ace-icon fa fa-cog bigger-150"></i>
            </div>
            <div class="ace-settings-box clearfix" id="ace-settings-box">
                <div class="pull-left width-50">
                    <!-- #section:settings.skins -->
                    <div class="ace-settings-item">
                        <div class="pull-left">
                            <select id="skin-colorpicker" class="hide">
                                <option data-skin="no-skin" value="#438EB9" <?= !isset($_COOKIE['ace_skin']) || $_COOKIE['ace_skin'] != 'no-skin' ? 'selected' : '' ?> >#438EB9</option>
                                <option data-skin="skin-1" value="#222A2D" <?= isset($_COOKIE['ace_skin']) && $_COOKIE['ace_skin'] == 'skin-1' ? 'selected' : '' ?> >#222A2D</option>
                                <option data-skin="skin-2" value="#C6487E" <?= isset($_COOKIE['ace_skin']) && $_COOKIE['ace_skin'] == 'skin-2' ? 'selected' : '' ?> >#C6487E</option>
                                <option data-skin="skin-3" value="#D0D0D0" <?= isset($_COOKIE['ace_skin']) && $_COOKIE['ace_skin'] == 'skin-3' ? 'selected' : '' ?> >#D0D0D0</option>
                            </select>
                        </div>
                        <span>&nbsp;肤色切换</span>
                    </div>

                    <!-- /section:settings.skins -->

                    <!-- #section:settings.navbar -->
                    <div class="ace-settings-item">
                        <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-navbar" />
                        <label class="lbl" for="ace-settings-navbar">&nbsp; 固定导航</label>
                    </div>

                    <!-- /section:settings.navbar -->

                    <!-- #section:settings.sidebar -->
                    <div class="ace-settings-item">
                        <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-sidebar" />
                        <label class="lbl" for="ace-settings-sidebar">&nbsp; 固定菜单栏</label>
                    </div>
                    <!-- /section:settings.sidebar -->

                    <!-- #section:settings.container -->
                    <div class="ace-settings-item">
                        <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container" />
                        <label class="lbl" for="ace-settings-add-container">&nbsp; 宽窄屏切换</label>
                    </div>
                    <!-- /section:settings.container -->
                </div><!-- /.pull-left -->

                <div class="pull-left width-50">
                    <!-- #section:basics/sidebar.options -->
                    <div class="ace-settings-item">
                        <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-hover" />
                        <label class="lbl" for="ace-settings-hover">&nbsp; 内级栏目切换</label>
                    </div>

                    <div class="ace-settings-item">
                        <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-compact" />
                        <label class="lbl" for="ace-settings-compact">&nbsp; 菜单栏切换</label>
                    </div>

                    <div class="ace-settings-item">
                        <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-highlight" />
                        <label class="lbl" for="ace-settings-highlight">&nbsp; 当前菜单凸显</label>
                    </div>
                    <!-- /section:basics/sidebar.options -->
                </div><!-- /.pull-left -->
            </div><!-- /.ace-settings-box -->
        </div><!-- /.ace-settings-container -->

        <!-- /section:settings.box -->
        <div class="page-content-area">
            <div class="row">
                <div class="col-xs-12">
                    <form class="form-horizontal" role="form" action="" method="get">
                        <div class="form-group col-sm-10 col-xs-12">
                            <input type="text" name="keywords" value="<?= $keywords ?>" placeholder="关键字:多个用‘英文逗号’隔开" class="col-xs-7 col-sm-5" data-rel="tooltip" title="关键字:多个用‘英文逗号’隔开">
                            &nbsp;<button class="btn btn-info btn-sm" data-rel="tooltip" title="搜索"><i class="ace-icon fa fa-search"></i>search</button>
                        </div>
                    </form>
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                                <tr>
<!--                                    <th>酒店名称</th>
                                    <th>酒店编号</th>
                                    <th>星级</th>
                                    <th>电话</th>
                                    <th>地址</th>
                                    <th>酒店状态</th>
                                    <th>更新时间</th>
                                    <th>是否推荐</th>
                                    <th>上架情况</th>-->
                                    <th>酒店名称</th>
                                    <th>酒店编号</th>
                                    <th>星级</th>
                                    <th>类型</th>
                                    <th>地址</th>
                                    <th>更新时间</th>
                                </tr>
                            </thead>

                            <tbody>
                                <?
                                if($re){
                                foreach($re as $k=>$v){?>
                                <tr>
                                    <td><?= $v['name'] ?></td>
                                    <td><?= $v['hid'] ?></td>
                                    <td><?= $v['tjgradenum'] ?></td>
                                    <td><?= $v['type'] ?></td>
                                    <td><?= $v['address'] ?></td>
                                    <!--<td><?= $v['status'] == 1 ? '<font class="badge badge-success">正常</font>' : '<font class="badge badge-danger">冻结</font>' ?></td>-->
                                    <td><?= date('Y-m-d H:i:s', $v['created']);?></td>
<!--                                    <td>
                                        <select lang="<?= $v['id'] ?>" name="isindex">
                                            <option value="0"  <?= $v['isindex'] == 0 ? 'selected' : '' ?> >无推荐</option>
                                            <option value="1" <?= $v['isindex'] == 1 ? 'selected' : '' ?> >热门酒店</option>
                                            <option value="2" <?= $v['isindex'] == 2 ? 'selected' : '' ?> >超值酒店</option>
                                            <option value="3" <?= $v['isindex'] == 3 ? 'selected' : '' ?> >品牌酒店</option>
                                        </select>
                                    </td>
                                    <td>
                                        <select lang="<?= $v['id'] ?>" name="grounding">
                                            <option value="0"  <?= $v['grounding'] == 0 ? 'selected' : '' ?> >已上架</option>
                                            <option value="1" <?= $v['grounding'] == 1 ? 'selected' : '' ?> >已下架</option>
                                        </select>
                                    </td>-->
                                </tr>
                                <?}
                                }
                                ?>
                            </tbody>
                        </table>
                    </div>
<?= $pageHtml ?>
                </div>
            </div>
        </div><!-- /.page-content-area -->
    </div><!-- /.page-content -->
</div><!-- /.main-content -->
<!-- inline scripts related to this page -->

<script type="text/javascript">
    $('select[name="isindex"]').change(function() {
        $(this).prop('disabled', true);
        $.ajax({
            type: 'POST',
            url: '<?= $this->url("hotel/isindex") ?>',
            data: 'kid=' + $(this).attr('lang') + '&isindex=' + $(this).val(),
            dataType: 'json',
            success: function(r) {
                if (r.state == 1) {
                    gritter("gritter-success gritter-light", 3000, "操作提示", r.html);
                    $('select[name="isindex"]').prop('disabled', false);
                } else {
                    gritter("gritter-error gritter-light", 3000, "操作提示", r.html);
                    $('select[name="isindex"]').prop('disabled', false);
                }
            },
            error: function() {
                gritter("gritter-error gritter-light", 3000, "操作提示", "网络错误！请联系我方工作人员。");
            }
        });
    });
    $('select[name="grounding"]').change(function() {
        $(this).prop('disabled', true);
        $.ajax({
            type: 'POST',
            url: '<?= $this->url("hotel/grounding") ?>',
            data: 'kid=' + $(this).attr('lang') + '&grounding=' + $(this).val(),
            dataType: 'json',
            success: function(r) {
                if (r.state == 1) {
                    gritter("gritter-success gritter-light", 3000, "操作提示", r.html);
                    $('select[name="grounding"]').prop('disabled', false);
                } else {
                    gritter("gritter-error gritter-light", 3000, "操作提示", r.html);
                    $('select[name="grounding"]').prop('disabled', false);
                }
            },
            error: function() {
                gritter("gritter-error gritter-light", 3000, "操作提示", "网络错误！请联系我方工作人员。");
            }
        });
    });
</script>